package com.bw.hzcontroller;

import com.bw.bean.HZ;
import com.bw.service.IHzService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class controller {
    @Autowired
    IHzService service;
    @RequestMapping("/chaxun")
    public List<HZ> chaxun(String likename, String phone, String start, String end) {
        return service.chaxun( likename,  phone,  start,  end);
    }
    @RequestMapping("/add")
    public int add( HZ hz) {
        System.out.println(hz);
        return service.add(hz);
    }

    @RequestMapping("/adds")
    public int adds(@RequestBody List<HZ> hzs) {
        return service.adds(hzs);
    }

    @RequestMapping("/del")
    public int del(String id) {
        return service.del(id);
    }
    @RequestMapping("/dels")
    public int dels(String id) {
        return service.dels(id);
    }
}
